﻿@model PagedList.IPagedList<WebDKMH.Models.sinhvien>
@using PagedList.Mvc;
@{
    ViewBag.Title = "dssv";
    Layout = "~/Views/Shared/admin.cshtml";


}
<link href="~/Content/PagedList.css" rel="stylesheet" />
<div class="Main-Content-1">
    <div class="Main-Content-1-Tieude">
        <img src="~/Images/icon_dangky.png" />
        <ul>
            <li>
                <h2>DANH SÁCH SV</h2>
            </li>
        </ul>
    </div>
    <div class="Main-Content-1-Noidung">
        <p>
            @using (Html.BeginForm("dssv", "Admin", FormMethod.Get))
            {
            <p>
                @Html.DropDownList("searchString", "All")
                <input type="submit" value="Search" />
            </p>
            }
            </p>
            <div>
                <table class="table" border="1" cellspacing="0" style="border: 1px groove #0976f5; width: 750px; margin: auto; ">
                    <tr style=" color: #ffffff; background: #4395f5;">
                        <th style="width:50px;">STT </th>
                        <th style="width:80px;">Mã Sinh Viên</th>
                        <th style="width:150px">Họ Tên</th>
                        <th>Ngày Sinh</th>
                        <th>Giới Tính</th>
                        <th>Mã Lớp</th>
                        <th>Khóa Học</th>
                        <th>Nơi Sinh</th>
                        <th>Tên Khoa</th>
                        <th>Email</th>
                        <th>Sửa</th>
                        <th>Xóa</th>
                    </tr>
                    @{
                        int xp=0;
                        if (Request.QueryString["page"] == null){
                            xp = 1;}
                        else { 
                            xp = Convert.ToInt16(Request.QueryString["page"]);}

                        int i = (xp - 1) * 100 + 1;

                    }
                    @foreach (var item in Model)
                    {
                        
                        <tr style="color: #0c1574; border-collapse: collapse;">
                            <td style="padding-left:20px">@i</td>
                            <td style="padding-left:5px">@Html.DisplayFor(modelItem => item.masv)</td>
                            <td style="padding-left:5px">@Html.DisplayFor(modelItem => item.ho) @Html.DisplayFor(modelItem => item.ten)</td>
                            <td style="padding-left:5px">@Html.DisplayFor(modelItem => item.ns0)</td>
                            <td style="padding-left:5px">@Html.DisplayFor(modelItem => item.gioitinh)</td>
                            <td style="padding-left:5px">@Html.DisplayFor(modelItem => item.malop)</td>
                            <td style="padding-left:5px">@Html.DisplayFor(modelItem => item.khoahoc)</td>
                            <td style="padding-left:5px">@Html.DisplayFor(modelItem => item.noisinh)</td>
                            <td style="padding-left:5px">@Html.DisplayFor(modelItem => item.tenkhoa)</td>
                            <td style="padding-left:5px">@Html.DisplayFor(modelItem => item.email)</td>

                            <td>@Html.ActionLink("Chỉnh sửa", "suasv", new { masv = item.masv }) </td>
                            <td>@Html.ActionLink("Xóa", "Xoasv", new { masv = item.masv }) </td>

                        </tr>
                        i = i + 1;
                    }

                </table>
            </div>
            <a href=@Url.Action("themsv","admin")>
                <input style=" width: 80px; height: 30px; float: left;margin-left :150px;   margin-top: 20px;" id="OK" type="submit" value="Thêm" />
            </a>
            <input style=" width: 80px; height: 30px; float: left;margin-left :115px;   margin-top: 20px;" id="IN" type="submit" value="In Ra" />
            <input style=" width: 80px; height: 30px; float: right; margin-right:150px;   margin-top: 20px;" id="Xuat" type="reset" value="Xuất Flie" />
        </div>
        Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
        @Html.PagedListPager(Model, page => Url.Action("dssv", new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }))
    </div>
    